#include "rclcpp/rclcpp.hpp"
#include "data_reflow/data_catcher.h"
#include "data_reflow/config_manager.h"

int main(int argc, char *argv[])
{
    rclcpp::init(argc, argv);

    // 加载配置（全局仅一次）
    std::string config_path = "src/data_reflow/config/config.yaml";
    if (!data_reflow::ConfigManager::get_instance().load_config(config_path))
    {
        RCLCPP_ERROR(rclcpp::get_logger("test_data_catcher_node"), "配置文件加载失败: %s", config_path.c_str());
        return 1;
    }

    // 创建采集节点
    auto node = std::make_shared<data_reflow::SensorDataPub>();
    rclcpp::spin(node);

    rclcpp::shutdown();
    return 0;
}